<template>
    <h3>自定义事件组件交互</h3>
    <button @click="SendClickHandle"> 点击传递 </button>
</template>

<script>
export default{
    name:"MyComponent",
    data(){
        return {
            message:"传递数据"
        }
    },
    methods:{
        SendClickHandle(){
            this.$emit("OnEvent",this.message);
        }
    }
}
</script>

<style scoped>

h3{
    color: red;
}
</style>